package com.qys.livesMall.shop.modal.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("h2_shop_goods_sku")
@Schema(name = "ShopGoodsSku", description = "sku库存")
public class ShopGoodsSku implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "店铺id")
    private Long shopId;

    @Schema(description = "店铺商品id")
    private Long shopGoodsId;

    @Schema(description = "商品id")
    private Long goodsId;

    @Schema(description = "skuId")
    private Long skuId;
    @Schema(description = "商品名字")
    @TableField(exist=false)
    private String goodsName;
    @Schema(description = "sku名字")
    private String skuName;
    @Schema(description = "规格")
    private String skuAttr;
    @Schema(description = "图片")
    private String image;
    @Schema(description = "原价")
    private BigDecimal originalPrice;

    @Schema(description = "现价")
    private BigDecimal price;

    @Schema(description = "总数量")
    private Integer totalNum;

    @Schema(description = "可用数量")
    private Integer availableNum;

    @Schema(description = "冻结数量")
    private Integer freezeNum;

    @Schema(description = "状态:1上架,0下架")
    private boolean status;

    @TableField(exist=false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

}

